﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LaoLuo
{
    /// <summary>
    /// list with fixed size, insertion order is preserved. element last inserted will be the first out when traversed
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class SizedList<T> : SizedIList<T, List<T>>
    {
        /// <summary>
        /// init a <see cref="SizedList&lt;T>"/>
        /// </summary>
        /// <param name="size">fixed-size of this list</param>
        /// <param name="items">elements to fill</param>
        public SizedList(int size, params T[] items)
            :base(size, items.AsEnumerable())
        {

        }

        /// <summary>
        /// init a <see cref="SizedList&lt;T>"/>
        /// </summary>
        /// <param name="size">fixed-size of this list</param>
        /// <param name="items">elements to fill</param>
        public SizedList(int size, IEnumerable<T> items = null)
            : base(size, items)
        {

        }
    }
}
